package com.atguigu.gulimall.product.service;

import com.atguigu.gulimall.product.vo.AttrGroupRelationVo;
import com.atguigu.gulimall.product.vo.AttrRespVo;
import com.atguigu.gulimall.product.vo.AttrVo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.atguigu.common.utils.PageUtils;
import com.atguigu.gulimall.product.entity.AttrEntity;

import java.util.List;
import java.util.Map;

/**
 * 商品属性
 *
 * @author gyhe10
 * @email gyhe10@163.com
 * @date 2024-08-17 10:17:20
 */
public interface AttrService extends IService<AttrEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void saveAttr(AttrVo attrVo);

    PageUtils queryBaseAttrPage(Map<String, Object> params, Long catelogId);

    AttrRespVo getAttrInfo(Long attrId);

    void updateAttr(AttrVo attrVo);

    PageUtils queryAttrPage(Map<String, Object> params, String attrType, Long catelogId);

    List<AttrEntity> getRelationAttr(Long attrGroupId);

    void deleteRelation(AttrGroupRelationVo[] vos);

    PageUtils getNotRelationAttr(Map<String, Object> params, Long attrGroupId);

    void removeAttrAndRelation(Long[] attrIds);

    /**
     * 查询出当前 spuId 所关联的规格参数中可以被检索的规格参数的 ID 集合
     * @param baseAttrIdListForSpu
     * @return
     */
    List<Long> selectSearchAttrs(List<Long> baseAttrIdListForSpu);
}

